*** This file reproduces the tables and figures in the main manuscript based on analyses for each country. To reproduce them, you first have to run the replication files for the individual countries and store the output in the relevant directory. 


**Tables with results based on the results of the party polarization analyses for each country. The results of these analyses can be obtained by running the replication files for the individual countries and storing the outputs in the relevant directory

cd "C:\Users\au22016\Dept of Pol Science Dropbox\Rune Stubager\02_ClassIDscandi\Data\" // replace with your directory

foreach n in m1uk m2uk m3uk m1us m2us m3us m1no m2no m3no m1dk m2dk m3dk {
	est use `n'
	eststo `n'
}

**Tables for main paper

*Table 2

esttab m1uk m2uk m3uk m1us m2us m3us using parpolusuk.rtf, replace keep( 1.classid2 ecopos autlib 1.classid2#c.ecopos 1.classid2#c.autlib) coef(1.classid2 "Middel class identity" ecopos "Economic polarization" autlib "Social polarization" 1.classid2#c.ecopos "MC-ID*Econ pol." 1.classid2#c.autlib "MC-ID*Soc pol." ) ml(MI MII MIII MIV MV MVI) mgroups("Britain" "USA", pattern(1 0 0 1 0 0)) noomit b(1) se(1) modelwidth(7) nonumbers nonote nolegend eql(none) nogaps onecell lines

*Table 3

esttab m1dk m2dk m3dk m1no m2no m3no using parpoldkno.rtf, replace keep( 1.classid2 ecopos autlib 1.classid2#c.ecopos 1.classid2#c.autlib) coef(1.classid2 "Middel class identity" ecopos "Economic polarization" autlib "Social polarization" 1.classid2#c.ecopos "MC-ID*Econ pol." 1.classid2#c.autlib "MC-ID*Soc pol." ) ml(MI MII MIII MIV MV MVI) mgroups("Denmark" "Norway", pattern(1 0 0 1 0 0)) noomit b(1) se(1) modelwidth(7) nonumbers nonote nolegend nogaps onecell lines


**Figures for main paper 
cd "C:\Users\\`=c(username)'\Dropbox\02_ClassIDscandi\Outputs\Final figures" // replace with your directory

* Figure 1: Distribution of class identification over time
grc1leg classdist3DK.gph classdist3NO.gph classdist3Britain.gph USclassdist3.gph, title("") //saving(classdist_comp.gph, replace) 
//graph export classdist_comp.png, replace

* Figure 2: Class identification and attitudes to redistribution
grc1leg eclr2multiDK.gph eclr2multiNO.gph eclr2multiBritain.gph eclr2multiUS.gph, title("") //saving(eclr2multi_comp.gph, replace)
//graph export eclr2multi_comp.png, replace

* Figure 3: Class identificaiton and attitudes to immigration
grc1leg img2multiDK.gph img2multiNO.gph img2multiBritain.gph img2multiUS.gph, title("") //saving(img2multi_comp.gph, replace)
//graph export img2multi_comp.png, replace

* Figure 4: Class identification and party choice in Denmark. Also generated directly by replicationfile_DK(updated)_CPS
grc1leg oldleft2multiDK.gph oldright2multiDK.gph newleft2multiDK.gph newright2multiDK.gph, title(Denmark) //saving(party2multiDK.gph, replace)
//graph export party2multiDK.png, replace

* Figure 5: Class identification and party choice in Norway.  Also generated directly by replicationfile_NO(updated)_CPS
grc1leg oldleft2multiNO.gph oldright2multiNO.gph newleft2multiNO.gph newright2multiNO.gph, title(Norway) //saving(party2multiNO.gph, replace)
//graph export party2multiNO.png, replace

* Figure 6: Class identification and party choice in Britain and the US.
grc1leg lab2multiBritain.gph cons2multiBritain.gph dem2multiUS.gph rep2multiUS.gph, title("Britain and US") // saving(party2multiBritainUS.gph replace)
//graph export party2multiBritainUS.png